import React, { useEffect, useState } from "react";
import { Button } from "antd";

import index from "../../store/index";
import './ceshi.css'
// console.log(index.getState())
index.subscribe(() => {
  console.log(index.getState())
})


function Ceshi() {

  function cl() {
    // index.dispatch({ type: "change_name", name: "abc" })
    index.dispatch({ type: "change_age", num: 20 })
  }
  function dl() {
    // index.dispatch({ type: "change_name", name: "abc" })
    localStorage.setItem('token_key', 'aoshfoifojiojroihqierh')
    index.dispatch({ type: "denglu", token: 'aoshfoifojiojroihqierh' })
  }
  return (
    <div>
      <div id="main">
        测试
        <Button onClick={() => cl()}>点击</Button>
        <Button onClick={() => dl()}>登录</Button>
      </div>
      <div>
        <div className="clip">
          123
        </div>
      </div>
    </div>
  );
}

export default Ceshi;
